{{include file="common@layout/_meta_x-admin" /}}
<body>
<style>
    .downLoading{text-decoration: none;color:white;display: inline-block;padding:  10px;border-radius: 5px;background:cadetblue}
</style>
<div class="layui-fluid">
    <div class="layui-row">
        <div class="layui-col-md12">
            <form class="layui-form">
                订单详情
                {{:widget('common/Form/manyInput',[[['lable' => '订单号','name' => '','value' => $orderGoods.order_number,'require' => false,'disabled' => true],
                ['lable' => '店铺名称','name' => '','value' => $orderGoods.withstore.company_name,'require' => false,'disabled' => true]]])}}
                {{:widget('common/Form/manyInput',[[['lable' => '昵称','name' => '','value' => $orderGoods.withuser.nickname,'require' => false,'disabled' => true],
                ['lable' => '类型','name' => '','value' => $ogt[$orderGoods.type],'require' => false,'disabled' => true]]])}}
                {{:widget('common/Form/manyInput',[[['lable' => '规格','name' => '','value' => $orderGoods.category_group_name,'require' => false,'disabled' => true],
                ['lable' => '实际支付金额','name' => '','value' => $orderGoods.real_price,'require' => false,'disabled' => true]]])}}
                {{:widget('common/Form/manyInput',[[['lable' => '状态','name' => '','value' => $ogs[$orderGoods.status],'require' => false,'disabled' => true],
                ['lable' => '创建时间','name' => '','value' => $orderGoods.created_at,'require' => false,'disabled' => true]]])}}

                {{neq name="orderGoods.user_address_id" value="0"}}
                    {{:widget('common/Form/manyInput',[[['lable' => '姓名','name' => '','value' => $orderGoods.user_address.name,'require' => false,'disabled' => true],
                    ['lable' => '手机号码','name' => '','value' => $orderGoods.user_address.phone,'require' => false,'disabled' => true]]])}}
                    {{:widget('common/Form/input',['收货地址','',$orderGoods.user_address.detail,true,true])}}
                {{/neq}}
                {{:widget('common/Form/manyInput',[[['lable' => '备注','name' => '','value' => $orderGoods.remark,'require' => false,'disabled' => true],
                ['lable' => '预留手机号码','name' => '','value' => $orderGoods.phone,'require' => false,'disabled' => true]]])}}
                {{eq name="orderGoods.status" value="2"}}
                {{:widget('common/Form/manyInput',[[['lable' => '支付方式','name' => '','value' => $ogp[$orderGoods.pay_type],'require' => false,'disabled' => true],
                ['lable' => '支付时间','name' => '','value' => $orderGoods.update_at,'require' => false,'disabled' => true]]])}}
                {{/eq}}
                {{eq name="orderGoods.status" value="2"}}<a id="confirm" class="downLoading">确认订单</a>{{/eq}}
                {{volist name="sarr" id="sa"}}
                <a  class="downLoading download" data-start={{$sa[0]}}>下载{{$sa[0]}}-{{$sa[1]}}</a>
                {{/volist}}
            </form>
            <table class="layui-table layui-form">
                <thead>
                <tr>
                    <th>数量</th>
                    <th>图片</th>
                </thead>
                <tbody>
                {{volist name="detail" id="vo"}}
                <tr>
                    <td>{{$vo.file_count}}</td>
                    {{eq name="orderGoods.file_type" value="1"}}
                    <td><img src="{{$vo.domain_url}}" onclick="previewImg(this)" /></td>
                    {{else}}
                    <td><img src="/static/img/word.jpg" onclick="previewImg(this)" /></td>
                    {{/eq}}
                </tr>
                {{/volist}}
                </tbody>
            </table>
        </div>
    </div>
</div>
</body>
<script>
    $(function () {
        $("#confirm").click(function () {
            $.ajax({
                url:"edit",type:"post",dataType:"text json",
                data:{id:"{{$orderGoods.id}}"},
                success:function() {
                    window.location.reload()
                }
            })
        })
        $(".download").click(function () {
            var _this = $(this);
            layer.msg('正在下载图片。。。');
            _this.html('正在下载图片')
            _this.css('background-color', '#778899')
            var url = 'downloadImg?id={{$orderGoods.id}}&start='+_this.data('start');
            window.location.href=url;
        })
    })
    layui.use(['form','jquery'], function(){
        var form = layui.form;
        var $ = layui.jquery;

        //监听提交
        form.on('submit(submitForm)', function(data){
            ajaxRequest('',data.field)
            return false;
        });
    });
</script>
